package com.chenhao.springcloud.chenhaodatastructureservice.line;

/**
 * Description:自定义类
 *
 * @author chenhao
 * @date 2020/12/2 14:25
 */
public class Student {
    private String name;

    public Student(String name){
        this.name = name;
    }

    /**
     * 重写equals方法
     *
     * @param student
     * @return
     */
    @Override
    public boolean equals(Object student){
        if (this ==student) {
            return true;
        }
        if (student ==null){
            return false;
        }
        if (this.getClass()!=student.getClass()){
            return false;
        }
        Student another = (Student)student;
        return this.name.equals(another.name);
    }
}
